import {
  PET_STATE_LIST,
  IS_CLOSE_CHILDREN_LIST,
  IS_CLOSE_OTHER_PET_LIST,
} from '@/const/type';
export const tableOption = () => {
  return {
    ...window.$crudMixins.tableOptions,
    addBtn: false,
    editBtn: false,
    delBtn: false,
    menuWidth: 260,
    labelWidth: 140,
    emptyBtn: false,
    submitBtn: false,
    detail: true,
    group: [
      {
        label: '宠物信息',
        prop: 'group2',
        column: [
          {
            label: '宠物快照',
            prop: 'petPicture',
            type: 'upload',
            listType: 'picture-img',
            span: 12,
          },
          {
            label: '宠物昵称',
            prop: 'username',
            search: true,
            rules: [
              {
                required: true,
                message: '请输入宠物昵称',
              },
              {
                min: 2,
                max: 20,
                message: '长度在 2 到 20 个字符',
                trigger: 'blur',
              },
            ],
          },
          {
            type: 'select',
            label: '宠物性别',
            prop: 'nickname',
            rules: [
              {
                required: true,
                message: '请选择宠物性别',
              },
            ],
            dicData: [],
          },
          {
            label: '项圈编号',
            prop: 'code',
          },
          {
            label: '宠物类型',
            prop: 'code',
          },
          {
            label: '宠物品种',
            prop: 'type',
            search: true,
            type: 'cascader',
            dicData: [
              {
                label: '猫咪',
                value: 'CAT',
                parent: '0',
                children: [
                  {
                    label: '布偶猫',
                    value: 'BUOU',
                    parent: 'CAT',
                  },
                  {
                    label: '加菲猫',
                    value: 'JIAFEI',
                    parent: 'CAT',
                  },
                  {
                    label: '金吉拉',
                    value: 'JINJILA',
                    parent: 'CAT',
                  },
                  {
                    label: '缅因猫',
                    value: 'MIANYIN',
                    parent: 'CAT',
                  },
                  {
                    label: '美国短毛猫',
                    value: 'DUANMAO',
                    parent: 'CAT',
                  },
                  {
                    label: '苏格兰折耳猫',
                    value: 'ZHEER',
                    parent: 'CAT',
                  },
                  {
                    label: '暹罗猫',
                    value: 'XIANLUO',
                    parent: 'CAT',
                  },
                  {
                    label: '中华田园猫',
                    value: 'TIANYUAN',
                    parent: 'CAT',
                  },
                  {
                    label: '奥西猫',
                    value: 'AOXI',
                    parent: 'CAT',
                  },
                  {
                    label: '阿比西尼亚猫',
                    value: 'ABIXINIYA',
                    parent: 'CAT',
                  },
                  {
                    label: '阿舍拉猫',
                    value: 'ASHELA',
                    parent: 'CAT',
                  },
                  {
                    label: '澳大利亚雾猫',
                    value: 'WU',
                    parent: 'CAT',
                  },
                  {
                    label: '伯曼猫',
                    value: 'BOMAN',
                    parent: 'CAT',
                  },
                  {
                    label: '巴厘猫',
                    value: 'BALI',
                    parent: 'CAT',
                  },
                  {
                    label: '波斯猫',
                    value: 'BOSI',
                    parent: 'CAT',
                    children: null,
                  },
                  {
                    label: '波米拉猫',
                    value: 'BOMILA',
                    parent: 'CAT',
                    children: null,
                  },
                ],
              },
              {
                label: '狗狗',
                value: 'DOG',
                parent: '0',
              },
            ],
          },
          {
            type: 'select',
            label: '驱虫情况',
            prop: 'nickname',
            rules: [
              {
                required: true,
                message: '请选择驱虫情况',
              },
            ],
            dicData: [],
          },
          {
            type: 'select',
            label: '绝育情况',
            prop: 'nickname',
            rules: [
              {
                required: true,
                message: '请选择绝育情况',
              },
            ],
            dicData: [],
          },
          {
            type: 'select',
            label: '疫苗情况',
            prop: 'nickname',
            rules: [
              {
                required: true,
                message: '请选择疫苗情况',
              },
            ],
            dicData: [],
          },
          {
            label: '收养来源',
            prop: 'userId',
            type: 'select',
            dicData: PET_STATE_LIST,
            rules: [
              {
                required: true,
                message: '请选择收养来源',
              },
            ],
          },
          {
            label: '收养日期',
            prop: 'createTime',
            type: 'datetime',
            format: 'yyyy-MM-dd',
            valueFormat: 'yyyy-MM-dd',
            search: true,
            width: 160,
            searchRange: true,
            rules: [
              {
                required: true,
                message: '请选择收养日期',
              },
            ],
          },
          {
            label: '所属爱心收容站',
            prop: 'userId',
            search: true,
            type: 'select',
            dicData: PET_STATE_LIST,
            rules: [
              {
                required: true,
                message: '请选择所属爱心收容站',
              },
            ],
          },
          {
            label: '收容站位置',
            prop: 'userId',
            detail: true,
          },
          {
            label: '出生日期',
            prop: 'createTime',
            type: 'date',
            format: 'yyyy-MM-dd',
            valueFormat: 'yyyy-MM-dd',
            rules: [
              {
                required: true,
                message: '请选择出生日期',
              },
            ],
          },
          {
            label: '年龄段',
            prop: 'createTime',
            type: 'select',
            rules: [
              {
                required: true,
                message: '请选择年龄段',
              },
            ],
          },

          {
            label: '性格标签',
            prop: 'createTime',
            type: 'select',
            rules: [
              {
                required: true,
                message: '请选择性格标签',
              },
            ],
            multiple: true,
          },
          {
            label: '体型',
            prop: 'createTime',
            type: 'select',
            rules: [
              {
                required: true,
                message: '请选择体型',
              },
            ],
          },
          {
            label: '体重（kg）',
            prop: 'createTime',
            rules: [
              {
                required: true,
                message: '请输入体重',
              },
            ],
          },
          {
            label: '毛色',
            prop: 'createTime',
            type: 'select',
            rules: [
              {
                required: true,
                message: '请选择毛色',
              },
            ],
          },
          {
            label: '毛发长度',
            prop: 'createTime',
            type: 'select',
            rules: [
              {
                required: true,
                message: '请选择毛发长度',
              },
            ],
          },
          {
            label: '是否亲近儿童',
            prop: 'code',
            type: 'radio',
            dicData: IS_CLOSE_CHILDREN_LIST,
            rules: [
              {
                required: true,
                message: '请选择是否亲近儿童',
              },
            ],
          },
          {
            label: '是否亲近其他宠物',
            prop: 'code',
            type: 'radio',
            dicData: IS_CLOSE_OTHER_PET_LIST,
            rules: [
              {
                required: true,
                message: '请选择是否亲近其他宠物',
              },
            ],
          },
          {
            label: '其他特征',
            prop: 'createTime',
            type: 'select',
            rules: [
              {
                required: true,
                message: '请选择其他特征',
              },
            ],
          },
          {
            label: '领养日期',
            format: 'yyyy-MM-dd',
            valueFormat: 'yyyy-MM-dd',
            prop: 'time',
            type: 'date',
          },
        ],
      },
      {
        label: '备注',
        prop: 'group1',
        labelWidth: 0,
        detail: true,
        column: [
          {
            label: '',
            prop: 'remark',
          },
        ],
      },
    ],
  };
};
